-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recover interactively when the folder is not specified or is wrong #147
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 45dcacd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/steiger/src/features/choose-root-folder/choose-from-similar.ts
Outdated
Show resolved
Hide resolved
I've not finished reviewing yet but left some first comments |
Also, question, should this be included in the next minor release? If so, then we need to change the destination branch to |
I don't think this is particularly ground-breaking, so I wouldn't mind including it in 0.5.4 as well. Although we will have to change the changeset |
packages/steiger/src/features/choose-root-folder/choose-from-similar.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Now it looks good to go
commit: |
Yes, you're right 👍, I missed that point during the review |
Closes #40. I wanted to start adding some delight ✨ to the CLI, this is the first step.
If the person doesn't specify any folder, we will now check if there's a
src
orapp
in the current folder and suggest those. We will also suggest to run in the current folder. If it matches what the person wanted to do, then we will print what command they should run next time if they want to repeat it. If it doesn't, we will casually mention the correct usage and leave the person alone (without an error exit code).If the person specifies a folder, but it doesn't exist or is a file (for example, when they don't use terminal autocomplete and make a typo), then we will assume that most of what they wrote is correct and will try to correct typos. For example, if they wrote
pachages/stieger/scr
, we can trace this path and realize that they probably meantpackages/steiger/src
and then suggest to run the command there.Screenshots
If no folder was specified and there are no obvious candidates in the current folder:
If that's not what the person wants:
When there's a
src
in the current folder:When they made a typo and there's an obvious candidate:
When they accept the suggestion, we're informing them of what command is actually being run now (so that they can copy it, for example):
Typos can occur in different path segments:
When there's a
dist
folder, we don't consider it as a candidate because it's very unlikely that someone wants to checkdist
:When there are several possible candidates that the person could mean: